package root.electronclass.electronclass.other.dialog

import android.content.Intent
import android.os.Bundle
import android.view.View
import root.electronclass.electronclass.common.base.CommonDialogFragment
import root.electronclass.electronclass.databinding.AttendanceDialogBinding
import root.electronclass.electronclass.other.AttestationActivity

class AttendanceDialog: CommonDialogFragment<AttendanceDialogBinding>() {
    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        binding.student.setOnClickListener {
            val intent = Intent(this.requireActivity(), AttestationActivity::class.java)
            intent.putExtra("RequestCode", AttestationActivity.ATTENDANCE)
            intent.putExtra("isStudent", true)
            startActivityForResult(intent, AttestationActivity.ATTENDANCE)
        }

        binding.teacher.setOnClickListener {
            val intent = Intent(this.requireActivity(), AttestationActivity::class.java)
            intent.putExtra("RequestCode", AttestationActivity.ATTENDANCE)
            startActivityForResult(intent, AttestationActivity.ATTENDANCE)
        }

        onCancelClick = {
            dismiss()
        }
    }

}